//
//  MYNewsBannersHeader.swift
//  MuYing
//
//  Created by tbb on 2019/8/2.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit
import SDCycleScrollView
class MYNewsBannersHeader: UITableViewHeaderFooterView, SDCycleScrollViewDelegate{
    @objc var imageUrlStrArr:[NSString]? {
        didSet {
            self.imgBannar.imageURLStringsGroup = imageUrlStrArr;
        }
    }
    
    lazy var imgBannar: MyBaseCycleScrollView = {
        let imgBannar = MyBaseCycleScrollView(frame: self.bounds, imageNamesGroup: nil);
        imgBannar?.delegate = self;
        imgBannar?.layer.cornerRadius = 18;
        imgBannar?.clipsToBounds = true;
        return imgBannar!;
    }()

    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier);
        self.contentView.backgroundColor = .white;//UIColorFromHex(rgbValue: 0xFAFAFA);
        self.contentView.addSubview(self.imgBannar);
        self.imgBannar.mas_makeConstraints { (make) in
            //make?.edges.mas_equalTo()(12);
            make?.top.mas_equalTo()(12);
            make?.left.mas_equalTo()(12);
            make?.right.mas_equalTo()(-12);
            make?.bottom.mas_equalTo()(-12);
        }
        

    }
    
    /** 点击图片回调 */
    func cycleScrollView(_ cycleScrollView: SDCycleScrollView!, didSelectItemAt index: Int) {
        
    }
    
    /** 图片滚动回调 */
    func cycleScrollView(_ cycleScrollView: SDCycleScrollView!, didScrollTo index: Int) {
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
